home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicTextAreaUI.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.3 KB  |  46 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.beans.PropertyChangeEvent;
  4. import javax.swing.JComponent;
  5. import javax.swing.JTextArea;
  6. import javax.swing.plaf.ComponentUI;
  7. import javax.swing.text.Element;
  8. import javax.swing.text.JTextComponent;
  9. import javax.swing.text.PlainView;
  10. import javax.swing.text.View;
  11. import javax.swing.text.WrappedPlainView;
  12.  
  13. public class BasicTextAreaUI extends BasicTextUI {
  14.    public View create(Element var1) {
  15.       JTextComponent var2 = ((BasicTextUI)this).getComponent();
  16.       if (var2 instanceof JTextArea) {
  17.          JTextArea var3 = (JTextArea)var2;
  18.          Object var4;
  19.          if (var3.getLineWrap()) {
  20.             var4 = new WrappedPlainView(var1, var3.getWrapStyleWord());
  21.          } else {
  22.             var4 = new PlainView(var1);
  23.          }
  24.  
  25.          return (View)var4;
  26.       } else {
  27.          return null;
  28.       }
  29.    }
  30.  
  31.    public static ComponentUI createUI(JComponent var0) {
  32.       return new BasicTextAreaUI();
  33.    }
  34.  
  35.    protected String getPropertyPrefix() {
  36.       return "TextArea";
  37.    }
  38.  
  39.    protected void propertyChange(PropertyChangeEvent var1) {
  40.       if (var1.getPropertyName().equals("lineWrap") || var1.getPropertyName().equals("wrapStyleWord")) {
  41.          ((BasicTextUI)this).modelChanged();
  42.       }
  43.  
  44.    }
  45. }
  46.